package com.qfedu.controller;

import com.qfedu.entity.GroupDepartData;
import com.qfedu.entity.ResponseData;
import com.qfedu.service.DepartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 部门相关
 */
@RestController
public class DepartController {

    @Autowired
    private DepartService departService;


    /**
     * 获取部门分组信息
     * @return
     */
    @RequestMapping("/groupByDept.do")
    public ResponseData  getCountByDepart(){

        ResponseData responseData = new ResponseData();

        GroupDepartData groupDepartData =  departService.getCountByDepart();

        responseData.setCode(0);
        responseData.setMsg("success");
        responseData.setData(groupDepartData);

        return responseData;
    }

}
